﻿<UserControl x:Class="Dispatcher.Views.CommonListView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <UserControl.Resources>

        <ResourceDictionary x:Key="MergedResources">
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="\Views\ResourceDictionary.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <LinearGradientBrush x:Key="NormalBrush" EndPoint="0,1" StartPoint="0,0">
                <GradientStop Color="White" Offset="0.0"/>
                <GradientStop Color="Gainsboro" Offset="1.0"/>
            </LinearGradientBrush>

            <Style x:Key="DataGridClickedCellStyle" TargetType="{x:Type DataGridCell}">
                <Setter Property="Background" Value="{StaticResource NormalBrush}"/>
            </Style>
        </ResourceDictionary>   
        
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <DataGrid ItemsSource="{Binding Items}"  
                  Name="ItemsDataGrid"
                  AllowDrop="True"
                  Drop="ItemsDataGrid_Drop"
                  KeyDown="ItemsDataGrid_KeyDown"
                  BeginningEdit="ItemsDataGrid_BeginningEdit"      
                  CellEditEnding="ItemsDataGrid_CellEditEnding"
                  PreviewKeyDown="ItemsDataGrid_PreviewKeyDown" 
                  MouseDoubleClick="ItemsDataGrid_MouseDoubleClick"
                  PreviewMouseMove="ItemsDataGrid_PreviewMouseMove"
                  AutoGeneratingColumn="ItemsDataGrid_AutoGeneratingColumn"
                  ScrollViewer.ScrollChanged="ItemsDataGrid_ScrollChanged"/>
    </Grid>
</UserControl>
